﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LTSMZ.life.Model;
using LTSMZ.life.DAL;

namespace LTSMZ.life.BLL
{
   public   class MemberBll
    {
       MemberDal dal = new MemberDal();
       /// <summary>
       /// 显示会员信息
       /// </summary>
       /// <returns></returns>
       public List<Member> ShowMember()
       {
           return dal.ShowMember();
       }
       /// <summary>
       /// 删除会员信息
       /// </summary>
       /// <param name="id"></param>
       /// <returns></returns>
       public int DelMember(int id)
       {
           return dal.DelMember(id);
       }
       /// <summary>
       /// 登录
       /// </summary>
       /// <param name="name"></param>
       /// <param name="pwd"></param>
       /// <returns></returns>
       public int DengMember(string name, string pwd)
       {
           return dal.DengMember(name,pwd);
       }

       /// <summary>
       /// 注册
       /// </summary>
       /// <param name="name"></param>
       /// <param name="pwd"></param>
       /// <returns></returns>
       public int ZhuMember(Member m)
       {
           return dal.ZhuMember(m);
       }
       ///// <summary>
       ///// 根据账号获取编号
       ///// </summary>
       ///// <param name="name"></param>
       ///// <returns></returns>
       //public int GetIdByName(string name)
       //{
       //    return dal.GetIdByName(name);
       //}
       /// <summary>
       /// 根据会员编号和商品编号判断该会员有没有买过该商品
       /// </summary>
       /// <param name="Mid"></param>
       /// <param name="Pid"></param>
       /// <returns></returns>
       public int GetCountByMidandPid(string name, int Pid)
       {
           return dal.GetCountByMidandPid(name, Pid);
       }
       /// <summary>
       /// 获取当前登录人的信息
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public Member GetByNameAll(string name)
       {
           return dal.GetByNameAll(name);
       }
    }
}
